-- delete from trb_iptu where exe_ano = 2008
-- delete from trb_iptu_taxa where tla_cod in ( select tla_cod from trb_iptu where exe_ano = 2008 )
-- delete from trb_lancamento where tla_cod in ( select tla_cod from trb_iptu where exe_ano = 2008 )

DECLARE @ANO INT 
SET @ANO = 2008

select COUNT(*) from trb_iptu where exe_ano = @ANO
select COUNT(*) from trb_iptu_taxa where tla_cod in ( select tla_cod from trb_iptu where exe_ano = @ANO)
select COUNT(*) from trb_iptu_infra_estrutura where tla_cod in ( select tla_cod from trb_iptu where exe_ano = @ANO)
select COUNT(*) from trb_iptu_pontuacao where tla_cod in ( select tla_cod from trb_iptu where exe_ano = @ANO)


select * from trb_iptu where exe_ano = @ANO and ipt_valor_iptu < 20
select * from trb_lancamento where tla_cod = 3154822

